Skip to content

Conversation

hz2
Copy link

@hz2 hz2 commented Aug 3, 2025

What does this PR do

  • replace libc::renameat2() withlibc::syscall() for broader compatibility
  • define syscall numbers manually for multiple architectures
  • update conditional compilation to support all Linux environments
  • expand test coverage for additional architectures

context: uutils/coreutils#8391

Checklist:

  • I have read CONTRIBUTING.md
  • I have written necessary tests and rustdoc comments
  • A change log has been added if this PR modifies nix's API

- replace libc::renameat2() with libc::syscall() for broader compatibility
- define syscall numbers manually for multiple architectures
- update conditional compilation to support all Linux environments
- expand test coverage for additional architectures

added changelog entry for renameat2 support

rust fmt

handle all linux archs instead of explictly defining them
@hz2 hz2 force-pushed the enhance-renameat2-portability branch from be76b59 to c841902 Compare August 4, 2025 13:58
Copy link
Member

@asomers asomers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nix avoids raw syscalls for good reason. Why do you need to do this? If musl does not define renameat2, then renameat2 shouldn't be used in musl.

@hz2
Copy link
Author

hz2 commented Aug 31, 2025

Nix avoids raw syscalls for good reason.

Do you mind sharing the good reason? I am personally unfamiliar with why it is or is not a good idea, but would love to learn.

Why do you need to do this? If musl does not define renameat2, then renameat2 shouldn't be used in musl.

The discussion here outlined the desire to use the nix crate, but I can continue with using raw syscalls.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants